﻿// Created by Windward Studios - no copyright is claimed. This code can be used in
// any manner by anyone for any reason. There is no copyright of any kind on it. You may
// use it in commercial products. You may change it without sharing those changes.
// We ask that you keep the "created by Windward Studios" in a comment at the top.

using System.Data.Common;
using Kailua.net.windward.utils;
using net.windward.utils.ado.ODBC;

namespace net.windward.utils.ado.Access
{
	/// <summary>
	/// Wraps a DbCommand object and provides a client independent method of setting parameters. All parameters are
	/// set as ? in the sql commands are are set based on their order. This also has an ExecuteInsert that if given
	/// a sql command to insert a single row, will return the value of the auto primary key for that row.
	/// </summary>
	public class WrAccessCommand : WrOdbcCommand
	{
		/// <summary>
		/// Create a DbCommand wrapper.
		/// </summary>
		/// <param name="provider">The provider for this command.</param>
		/// <param name="odbcProvider">The ODBC provider for the connection this command is for. Can be null.</param>
		public WrAccessCommand(DbProviderFactory provider, string odbcProvider)
			: base(provider, odbcProvider)
		{
			Trap.trap();
			syntax = new WrAccessSyntax(provider, odbcProvider);
		}
	}
}
